/*
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-09-30 10:28:33
 * @LastEditors: Aroma
 * @LastEditTime: 2024-09-30 11:16:24
 * @别瞎看: 你个无脑牛马
 */

import java.util.HashMap;
import java.util.Map;

/**
 * Test01Map
 */
public class Test01Map {

    public static void main(String[] args) {
        //实例化一个HashMap对象
        Map<Student,String> studentMap = new HashMap<>();
        studentMap.put(new Student("Aroma", 18), "班级1");
        studentMap.put(new Student("Aroma", 19), "班级2");
        studentMap.put(null,"班级1");
        studentMap.put(new Student("Aroma", 18), null);
        System.out.println(studentMap);
        System.out.println(studentMap.size());
        //遍历
        for(Map.Entry<Student,String> entry:studentMap.entrySet()){
            System.out.println(entry.getKey()+"-->"+entry.getValue());
        }
    }
}